package com.po.common.exception.vo;

import com.po.common.exception.enums.ExpcetionEnums;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author zxw
 * @date 2020/8/1 11:50
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class JsonResult {
    private Integer code;
    private String msg;
    private Object data;

    public JsonResult ok(ExpcetionEnums expcetionEnums) {
        JsonResult jsonResult = new JsonResult();
        jsonResult.setCode(expcetionEnums.getCode());
        jsonResult.setMsg(expcetionEnums.getMsg());
        return jsonResult;
    }
}
